PATH 
Mac OS 8 and 9 Developer Documentation > Text and Other International Services > Apple Type Services for Unicode Imaging (ATSUI) > Apple Type Services for Unicode Imaging Reference

     

ATSUClearLayoutCache

Clears the layout cache of a line or an entire text layout object.

OSStatus ATSUClearLayoutCache (
                     ATSUTextLayout iTextLayout,
                     UniCharArrayOffset iLineStart);
iTextLayout
A reference of type ATSUTextLayout. Pass a reference to an initialized text layout object whose layout cache you want to clear. You cannot pass NULL for this parameter.

iLineStart
A value of type UniCharArrayOffset. Pass the edge offset of the beginning of the line whose layout cache you want to discard. To clear the entire layout cache of an text layout object, pass the constant kATSUFromTextBeginning, described in Text Offset Constant.

function result
A result code. See Result Codes.
DISCUSSION
The layout cache contains all the layout information ATSUI needs to draw a range of text in a text layout object. This includes caret positions, the memory locations of glyphs, and other information needed to lay out the glyphs. This information is used when ATSUI redraws text that was recently drawn. It uses information in the layout cache to quickly lay out the text. When you clear the layout cache of a line or block of text, it takes ATSUI longer to redraw a line, since glyph layout must be performed again.

The ATSUClearLayoutCache function flushes the layout cache but does not alter previously set text layout attributes, soft line break positions, or the text memory location. Individual lines may be redrawn as before. If you do not care about retaining these values, you should dispose of the text layout object by calling the ATSUDisposeTextLayout function.

You should call ATSUClearLayoutCache when line breaks in a text layout object are altered (for example, if line justification is set to full justification). You can call ATSUClearLayoutCache to free memory associated with the layout results of a text layout object.

It is not an error if some or all of the lines do not already have layout caches. ATSUClearLayoutCache only clears the layout caches it can find.

VERSION NOTES
Available beginning with ATSUI 1.1.

© 2000 Apple Computer, Inc. – (Last Updated 25 Jan 00)